package com.zzu.base.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzu.base.controller.user.vo.UserGetRespVO;
import com.zzu.base.controller.user.vo.UserPageReqVO;
import com.zzu.base.entity.RoleDO;
import com.zzu.base.entity.UserDO;
import com.zzu.base.controller.auth.vo.LoginReqVO;
import com.zzu.base.controller.auth.vo.RegisterReqVO;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.List;

public interface UserService extends IService<UserDO> {
    UserDO getUserByUsername(String username);
    String login(LoginReqVO loginReqVO);
    int register(RegisterReqVO registerReqVO);
    List<RoleDO> getRolesByUserId(Long userId);
    Boolean addUserRole(Long userId, Long roleId);
    Boolean removeUserRole(Long userId, Long roleId);
    Boolean removeUser( Long id);
    Boolean update(UserDO userDO);
    IPage<UserDO> getUserPage(UserPageReqVO userPageReqVO);
    Boolean logout(HttpServletRequest request,
                   HttpServletResponse response);
}
